#include<stdio.h>
int main()
{
	int m;
	int sum=0;
	scanf("%d",&m);
	while(m)
	{
		int t=m;
		sum+=t%10;
		m=m/10;
	}
	printf("%d",sum);
	return 0;
}
